const express = require('express');
    dishRouter = require('../../../dish/server/routers/dish.server.router'),
        dishWebServiceRouter = require('../../../dish/server/routers/dish.webService.router'),
    userRouter = require('../../../user/server/routers/user.server.router'),
    orderRouter = require('../../../order/server/routers/order.server.router'),
    merchantRouter = require('../../../merchant/server/routers/merchant.server.router'),
        merchantWebServiceRouter = require('../../../merchant/server/routers/merchant.webService.router'),
        orderWebServiceRouter = require('../../../order/server/routers/order.webService.router'),
    filter = require('../filter/merchant.server.filter');

    module.exports = function (router) {

    router.get(['/', '/index'], function (req, res) {
        console.log('init');
        res.redirect('/index.html');
    });
    router.use('/user', userRouter);
    router.use('/dish', filter.filterLogin ,dishRouter);
    router.use('/merchants', merchantRouter);
    router.use('/dishWebService',dishWebServiceRouter);
    router.use('/orders',filter.filterLogin ,orderRouter);
        router.use('/orderWebService',orderWebServiceRouter);
        router.use('/merchantWebService',merchantWebServiceRouter);
};
